<script type="text/javascript">
//<![CDATA[
    function sendMail(){
		with(document.frmReg){
			//alert('메일 전송 구현할것');
			submit();
		}
    }

    function mailPreview(){
        window.open("","WIN_PREVIEW","width=800,height=800");
        with(document.frmReg){
			target = "WIN_PREVIEW";
			action="/mail/mailPreview";
			submit();
        }
    }
    
	$(function(){
		$("[name=template]").change(function(){
			with(document.frmReg){
				action = "/sms/smsForm";
				submit();
			}
		});

		//대상자
		$("[name=target]").click(function(){
			if($(this).val()=="manual"){//직접입력
				$("[name=hp]").attr("disabled",false);
				$("[name=hp]").focus();
			}else{
				$("[name=hp]").attr("disabled",true);
			}
		});
	});
//]]>
</script>
<div class="box_type02">
<h2 class="txt">SMS일괄발송</h2>
<p class="icon"><a href="javascript:void(0);" class="icon_m04">매뉴얼</a></p>

<!--[s] 쓰기 -->
<form name="frmReg" method="post" action="/sms/smsSend">
	<fieldset class="board_write">
		<legend>SMS일괄발송</legend>
		<table cellspacing="0" summary="SMS일괄발송" class="lines">
			<caption>SMS일괄발송</caption>
			<tr>
				<th scope="row" rowspan="3" width="140" class="vat"><label for="title" class="point">수신자</label></th>
				<td width="258">
					<div>
						<input type="radio" id="" name="target" class="ip_c" value="total" <?php echo set_radio('target', 'total', TRUE);?> /><label for="" class="txt_type01">회원전체 (<strong class="cff5400"><?php echo $target['total'];?></strong>)</label>
					</div>
				</td>
				<td rowspan="4" class="tac">
					<div>
						<div class="smsBg">
							<textarea name="content" rows="" cols="" class="ip_t"><?php echo $content;?></textarea>
							<input type="submit" class="btn_send" title="전송" value="" />
						</div>
					</div>
				</td>
			</tr>
			<tr>
				<td>
					<div><input type="radio" id="" name="target" value="birthday" <?php echo set_radio('target', 'birthday');?>  class="ip_c" /><label for="" class="txt_type01">금일 생일자 (<strong class="cff5400"><?php echo $target['birthday'];?></strong>)</label></div>
				</td>
			</tr>
			<tr>
				<td>
					<div>
						<input type="radio" id="" name="target" value="manual" <?php echo set_radio('target', 'manual');?>  class="ip_c" /><label for="" class="txt_type01">직접입력 </label>
						<input type="text" id="" name="hp" class="ip_i" style="width:147px;" value="" disabled />
					</div>
				</td>
			</tr>
			<tr>
				<th scope="row" class="vat"><p class="point">문구</p></th>
				<td>
					<div>
						<p class="mb5">
							<select name="template" class="ip_s" style="width:130px;">
								<option value="">직접입력</option>
								<?php 
									foreach($template_list as $item){
										$arrFile = explode('.txt',$item);
										$item = iconv('euc-kr','utf-8', $arrFile[0]);
										echo "<option value=\"{$item}\" ".set_select('template', $item).">{$item}</option>\n";
									}
								?>
							</select>
						</p>
						<p></p>
						<!--<textarea name="content" rows="" cols="" class="ip_t"></textarea>  -->
					</div>
				</td>
			</tr>
		</table>
	</fieldset>
</form>
<!--[e] 쓰기 -->

<!--[s] Tip -->
<dl id="tip" class="mt30">
	<dt>Tip</dt>
	<dd>인터넷익스플로러의 '호환성보기' 기능을 사용중인 접속자에게 자동으로 최신버전 기준으로 사이트를 출력하도록 처리합니다.</dd>
	<dd>코딩방식에 따라 특정 버전의 브라우저에서 사이트가 깨질수 있으니, 충분한 테스트 후 기능을 설정해 주시기 바랍니다.</dd>
</dl>
<!--[e] Tip -->
</div>